import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token_TTStarDataCenter'
const SuperUserTokenKey = 'Admin-Token_TTStar_Super'


const ProductUnitUserTokenKey = 'Admin-Token_Product_Super'
const AcceptUnitUserTokenKey = 'Admin-Token_Collection_Super'
const RegulatoryUserTokenKey = 'Admin-Token_Regulatory_Super'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getSuperUserToken() {
  if (Cookies.get(SuperUserTokenKey)) {
    return JSON.parse(Cookies.get(SuperUserTokenKey))
  } else {
    return {}
  }
}
export function removeSuperUserToken() {
   Cookies.remove(SuperUserTokenKey)
   Cookies.remove(ProductUnitUserTokenKey)
   Cookies.remove(AcceptUnitUserTokenKey)
   Cookies.remove(RegulatoryUserTokenKey)

}
